package cn.rxyb.desgin.observer;

import cn.rxyb.core.thread.ThreadPool;

/**
 * @author YJH
 * @version 1.0
 * @description
 * @date 2020/7/3 13:19
 */
public class ConcreteSubject extends AbstractSubject {


    public void notifyObserver(final String content) {
        System.out.println("具体发生得目标 --begin");

        observers.stream().forEach(e -> {
            ThreadPool.getInstance().getPoolExecutor().execute(() -> {
                e.response(content);
            });
        });
        System.out.println("具体发生得目标 --end");
    }
}
